Skip to content

Snowflake: parse ALTER STAGE (SET / RENAME TO)#9

Merged
wojpadlo merged 2 commits into
lav-379-2-for-over-cursorfrom
snowflake/alter-stage
Jun 8, 2026
Merged

Snowflake: parse ALTER STAGE (SET / RENAME TO)#9
wojpadlo merged 2 commits into
lav-379-2-for-over-cursorfrom
snowflake/alter-stage

Conversation

@wojpadlo

@wojpadlo wojpadlo commented Jun 8, 2026

Copy link
Copy Markdown

Summary

Adds ALTER STAGE parsing to the Snowflake dialect:

ALTER STAGE [IF EXISTS] <name> SET <stage-params/options>
ALTER STAGE [IF EXISTS] <name> RENAME TO <new_name>

SET captures the same property groups as CREATE STAGE (URL, STORAGE_INTEGRATION,
CREDENTIALS, ENCRYPTION, FILE_FORMAT, COPY_OPTIONS, DIRECTORY, COMMENT), reusing the
existing StageParamsObject / KeyValueOptions shapes rather than new bespoke structs.

Changes

  • New Statement::AlterStage { name, if_exists, operation } variant and
    AlterStageOperation { RenameTo(ObjectName), Set { .. } } enum, with Display
    and spans.rs coverage.
  • ALTER STAGE dispatch + parse_alter_stage in the Snowflake dialect.
  • Factored the shared CREATE STAGE property-group parsing into a private
    StageProperties / parse_stage_properties helper, reused by both
    CREATE STAGE and ALTER STAGE ... SET (no duplication).
  • Round-trip (Display) tests for the new forms in tests/sqlparser_snowflake.rs.

Consumed downstream by snowflake-rs LAV-487-4 (rewriter + UDF wiring).

🤖 Generated with Claude Code

Wojciech Padlo and others added 2 commits June 8, 2026 15:19
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
These checks were already red on the base branch (lav-379-2-for-over-cursor),
inherited from the cursor/scripting/ACCOUNT commits — unrelated to ALTER STAGE,
but required for green CI on this PR:

- codestyle: run cargo fmt --all across the crate
- lint: collapse a match-in-match (parser scripting list), replace a forbidden
  unreachable! in DESCRIBE object-type parsing with a parse error, and collapse
  nested match arms in the warehouse/account tests
- docs: drop unresolved intra-doc link brackets in scripting-list doc comments
- compile-no-std: gate 'use alloc::vec' behind not(feature = std) in spans.rs

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@wojpadlo wojpadlo merged commit 43c42ab into lav-379-2-for-over-cursor Jun 8, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant